package com.xizi.rabbit.config;

import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MQConfig {

    // 消息转换器MessageConverter
    // 可以把非标准化Message对象转换成我们的目标Message对象
    @Bean
    public MessageConverter messageConverter(){
        //返回 json消息转换器
        return new Jackson2JsonMessageConverter();
    }
}
